package cn.yh.action;

import cn.yh.biz.AdminBiz;
import cn.yh.model.Admin;

public class UpdateAdmin extends BaseAction {
	private int aid;
	private String aname;
	private String apwd;
	private String npwd;
	//管理员修改密码
	public String execute(){
		Admin admin = new Admin();
		admin.setAid(aid);
		admin.setApwd(apwd);
		System.out.println(aid+"---"+npwd);
		//创建个对象传过去
		AdminBiz ab = new AdminBiz();
		int flag = ab.updateAdmin(admin, npwd);
		System.out.println(flag);
		if(flag>0){
			return "success";
		}
		return "fail";
	}

	public int getAid() {
		return aid;
	}

	public void setAid(int aid) {
		this.aid = aid;
	}
	
	public String getNpwd() {
		return npwd;
	}

	public void setNpwd(String npwd) {
		this.npwd = npwd;
	}

	public String getAname() {
		return aname;
	}

	public void setAname(String aname) {
		this.aname = aname;
	}

	public String getApwd() {
		return apwd;
	}

	public void setApwd(String apwd) {
		this.apwd = apwd;
	}


	
}
